﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/validator.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/login.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/Controller.js"></script>
    <script src="../js/store.min.js"></script>
    <script src="../js/sweetalert.min.js"></script>
    <script>
        var mode;
        var id;
        var app = angular.module('myApp1', []);
        var param = common.getUrlArgStr();

        if (param.id != undefined && param.id != "") {

            id = param.id;
            mode = param.mode;

            app.controller('MyCtrl', function ($http, $scope) {
                $http.get('../api/enterprise/get/' + id).success(function (data) {

                    if (data == null)
                        window.location = "../login.html";

                    $scope.names = data;
                    $("#CompanyName").val(data.CompanyName);
                    $("#Address").val(data.Address);
                    $("#Web").val(data.Web);
                    $("#NatureNO").val(data.NatureNO);
                    $("#CSize").val(data.CSize);
                    $("#TypeNO").val(data.TypeNO);

                }).error(function (data, status, headers, config) {
                    common.alertMessage(data.Message, status);
                });

            });
        }

        function AfteAjax(ctx) {

            if (ctx == "" || ctx == null) {
                $('#divError').html("").append("提交错误，请重试！");
                return;
            }

            var user = store.get("User");
            user.CompanyID = ctx;
            store.set("User", user);

            if (mode == "edit")
                window.location = "info.html";
            else
                window.location = "Step2.aspx";
        }

        function Go() {

            if (!common.validateForm())
                return;

            var values = common.GetCtrlValues({
                ContentID: "formValidate"
            })

            values["Nature"] = $("#NatureNO").find("option:selected").text();
            values["CSizeDisplayName"] = $("#CSize").find("option:selected").text();
            values["Type"] = $("#TypeNO").find("option:selected").text();

            if (mode == "edit") {
                common.commonAjax({ type: 'Put', url: '../api/enterprise/put/' + id, data: values, sMethod: AfteAjax, loadingCtrl: $("#bodyContent") });
            }
            else
                common.commonAjax({ type: 'Post', url: '../api/enterprise/post', data: values, sMethod: AfteAjax, loadingCtrl: $("#bodyContent") });
        }

    </script>
</head>
<body id="bodyContent">
    <div id="searchPage"></div>
    <div class="main">
        <div class="audit-banner text-center">
            <h1>Open Enterprise Service</h1>
            <p>开通企业服务</p>
        </div>
        <div class="wrap">
            <div class="audit-wrap step-header">
                <ul class="clearfix">
                    <li>
                        <h2 style="color: #FF4500;" class="text-center">01</h2>
                        <div>提交公司基本信息</div>
                    </li>
                    <div class="step-line"></div>
                    <li>
                        <h2 class="text-center">02</h2>
                        <div>提交身份信息</div>
                    </li>
                    <div class="step-line"></div>
                    <li>
                        <h2 class="text-center">03</h2>
                        <div>提交公司营业执照证明</div>
                    </li>
                </ul>
            </div>
            <div class="audit-wrap step">
                <form id="formValidate" ng-app="myApp1" ng-controller="MyCtrl">
                    <div class="form-group">
                        <input type="text" placeholder="填写企业名称" data-error="请填写企业名称" required id="CompanyName" class="form-control">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <input type="text" placeholder="填写企业地址" data-error="请填写企业地址" required id="Address" class="form-control">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <input type="text" placeholder="填写企业官网" data-error="请填写企业官网" required id="Web" class="form-control">
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <select class="form-control" id="NatureNO" data-error="请选择企业类型" required min="1">
                            <option selected="selected" value="">请选择企业类型</option>
                            <option value="900000137">外资独资(欧美企业)</option>
                            <option value="900000138">外商独资(非欧美企业)</option>
                            <option value="900000139">合资/合作(欧美企业)</option>
                            <option value="900000140">合资/合作(非欧美企业)</option>
                            <option value="900000141">国营企业/上市企业</option>
                            <option value="900000142">民营/私营企业/非上市企业</option>
                            <option value="900000143">外企代表处</option>
                            <option value="900000144">其他</option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <select class="form-control" id="CSize" data-error="请选择企业规模" required min="1">
                            <option value="" selected="selected">请选择企业规模</option>
                            <option value="900000145">小于50人</option>
                            <option value="900000146">50-150</option>
                            <option value="900000147">151-500</option>
                            <option value="900000148">501-2000</option>
                            <option value="900000149">2000以上</option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group">
                        <select class="form-control" id="TypeNO" data-error="请选择行业" required min="1">
                            <option selected="selected" value="">请选择行业</option>
                            <option value="900000150">家电</option>
                            <option value="900000151">通讯</option>
                            <option value="900000152">房产建材</option>
                            <option value="900000153">医疗保健</option>
                            <option value="900000154">工业制造</option>
                            <option value="900000155">现代服务</option>
                            <option value="900000156">日用消费品</option>
                            <option value="900000157">酒店餐饮</option>
                            <option value="900000158">食品饮料</option>
                            <option value="900000159">化妆</option>
                            <option value="900000160">汽车</option>
                            <option value="900000161">服装</option>
                            <option value="900000162">奢侈品</option>
                            <option value="900000163">IT</option>
                            <option value="900000164">珠宝饰品</option>
                            <option value="900000165">广告企业</option>
                            <option value="900000166">烟酒类</option>
                            <option value="900000167">金融</option>
                            <option value="900000168">旅游航空</option>
                            <option value="900000169">其它</option>
                        </select>
                        <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group text-center"><button type="button" onclick="Go()" class="btn btn-default">下一步</button></div>
                </form>
            </div>
        </div>
    </div>
    <div class="footer">
        <div class="wrap">
            <div class="text-center">
                <p>深圳市*****有限公司 版权所有 2015-2016 粤ICP备440113331382568号<a href="" style="margin-left: 10px;">关于宾果高校  |  帮助中心  |  网站合作 |  版权说明 |  诚聘英才 |  联系我们</a></p>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    $("#searchPage").load("header.html", function () {
        SetCss("Info");
    });
</script>